home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / ODBCINF.PAK / ODBCINFO.CPP < prev    next >
C/C++ Source or Header  |  1997-05-06  |  3KB  |  112 lines

  1. // OdbcInfo.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4. // This is a part of the Microsoft Foundation Classes C++ library.
  5. // Copyright (C) 1992-1996 Microsoft Corporation
  6. // All rights reserved.
  7. //
  8. // This source code is only intended as a supplement to the
  9. // Microsoft Foundation Classes Reference and related
  10. // electronic documentation provided with the library.
  11. // See these sources for detailed information regarding the
  12. // Microsoft Foundation Classes product.
  13.  
  14. #include "stdafx.h"
  15. #include "OdbcInfo.h"
  16. #include "MySheet.h"
  17. #include "catsets.h"
  18. #include "DrvInfo.h"
  19.  
  20. #ifdef _DEBUG
  21. #define new DEBUG_NEW
  22. #undef THIS_FILE
  23. static char THIS_FILE[] = __FILE__;
  24. #endif
  25.  
  26. /////////////////////////////////////////////////////////////////////////////
  27. // COdbcInfoApp
  28.  
  29. BEGIN_MESSAGE_MAP(COdbcInfoApp, CWinApp)
  30.     //{{AFX_MSG_MAP(COdbcInfoApp)
  31.         // NOTE - the ClassWizard will add and remove mapping macros here.
  32.         //    DO NOT EDIT what you see in these blocks of generated code!
  33.     //}}AFX_MSG
  34.     ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  35. END_MESSAGE_MAP()
  36.  
  37. /////////////////////////////////////////////////////////////////////////////
  38. // COdbcInfoApp construction
  39.  
  40. COdbcInfoApp::COdbcInfoApp()
  41. {
  42.     // TODO: add construction code here,
  43.     // Place all significant initialization in InitInstance
  44. }
  45.  
  46. /////////////////////////////////////////////////////////////////////////////
  47. // The one and only COdbcInfoApp object
  48.  
  49. COdbcInfoApp theApp;
  50.  
  51. /////////////////////////////////////////////////////////////////////////////
  52. // COdbcInfoApp initialization
  53.  
  54. BOOL COdbcInfoApp::InitInstance()
  55. {
  56.     // Standard initialization
  57.     // If you are not using these features and wish to reduce the size
  58.     //  of your final executable, you should remove from the following
  59.     //  the specific initialization routines you do not need.
  60.  
  61. #ifdef _AFXDLL
  62.     Enable3dControls();            // Call this when using MFC in a shared DLL
  63. #else
  64.     Enable3dControlsStatic();    // Call this when linking to MFC statically
  65. #endif
  66.  
  67.     // create our property sheet
  68.     CMyPropertySheet    sheet(_T("ODBC Info"));
  69.  
  70.     // create all our property pages
  71.     CDriverInfo            DriverInfoPage(&m_Database);
  72.     CFunctions            FunctionsPage(&m_Database);
  73.     CSupportedSQL        SupportedSQLPage(&m_Database);
  74.     CDataTypes            DataTypesPage(&m_Database);
  75.     CIdentifiers        IdentifiersPage(&m_Database);
  76.     CLimits                LimitsPage(&m_Database);
  77.     CMisc1                Misc1Page(&m_Database);
  78.     CMisc2                Misc2Page(&m_Database);
  79.  
  80.     // add the pages to our sheet
  81.     sheet.AddPage(&DriverInfoPage);
  82.     sheet.AddPage(&FunctionsPage);
  83.     sheet.AddPage(&SupportedSQLPage);
  84.     sheet.AddPage(&DataTypesPage);
  85.     sheet.AddPage(&IdentifiersPage);
  86.     sheet.AddPage(&LimitsPage);
  87.     sheet.AddPage(&Misc1Page);
  88.     sheet.AddPage(&Misc2Page);
  89.  
  90.     // the property sheet is our main window
  91.     m_pMainWnd = &sheet;
  92.  
  93.     // For Win95: display icon in the caption bar
  94.     // and in the taskbar button
  95.     sheet.m_psh.dwFlags |= PSH_USEHICON;
  96.     sheet.m_psh.hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
  97.  
  98.     // run the app
  99.     sheet.DoModal();
  100.  
  101.     return FALSE;
  102. }
  103.  
  104. int COdbcInfoApp::ExitInstance() 
  105. {
  106.     // if a database is open, close it
  107.     if (m_Database.IsOpen())
  108.         m_Database.Close();
  109.     
  110.     return CWinApp::ExitInstance();
  111. }
  112.